from base.base import Base
from time import sleep
from selenium.webdriver.common.by import By

class SouSuoPage(Base):
    sousuokuang = (By.XPATH,'/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/androidx.drawerlayout.widget.DrawerLayout/android.widget.LinearLayout/android.widget.LinearLayout/android.widget.LinearLayout/android.widget.RelativeLayout/android.widget.RelativeLayout[2]/android.widget.RelativeLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.view.ViewGroup/android.widget.TextSwitcher/android.widget.TextView')

    shurukuang = (By.ID,'com.xiachufang:id/search_edit_text')

    sousuoanniu = (By.XPATH,'//android.widget.TextView[@text="搜索"]')

    dy = (By.XPATH,'//android.widget.TextView[@text="评分最高"]')

    dy2 = (By.XPATH,'//android.widget.TextView[@text="做过最多"]')

    dy3 = (By.XPATH,'//android.widget.TextView[@text="清空"]')

    def sousuoyewu(self,content):
        self.loc_ele(self.sousuokuang).click()
        sleep(3)
        self.loc_ele(self.shurukuang).send_keys(content)
        sleep(3)
        self.loc_ele(self.sousuoanniu).click()
        sleep(3)
